package com.lh.java.basic.datatype;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class TestRunTime {
	public static void main(String[] args) {
		Runtime runtime = Runtime.getRuntime();
		try {
//			runtime.exec("calc");
//			runtime.exec("cmd ping www.baidu.com");
            Process p = runtime.exec("ipconfig /all");  
            
            BufferedReader br = new BufferedReader(new InputStreamReader(p  

                          .getInputStream()));  

            String msg = null;  

            while ((msg = br.readLine()) != null) { 
            
                   System.out.println(msg);  

            }  

            br.close();  
		} catch (IOException e) {			
			e.printStackTrace();
		}

	}

}
